<?php
    $content_xml .= '
    <office:body>
        <office:text text:use-soft-page-breaks="true">
            <text:sequence-decls>
                <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
                <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
                <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
                <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
            </text:sequence-decls>';
    /*
     * voi face verificare si voi vedea daca exista poza clientului
     * daca este o pun iar daca nu nu.
     */
    
    if (isset($setari_client->cale_banner) && !empty($setari_client->cale_banner)) {
        /*
         * atunci voi pune poza
         */
        $info = getimagesize(FULL_IMAGE_PATH . $_SESSION['setari']->cale_banner);
        // TODO: Extrage calea banner-ului mai elegant, sa nu depinda de locatia fisierului!!!
        $content_xml .= '
            <text:p text:style-name="P15">
                <draw:frame draw:style-name="fr1" draw:name="graphics1" text:anchor-type="paragraph"
                            svg:width="' . $info[0] . '" svg:height="' . $info[1] . '" draw:z-index="0">
                    <draw:image xlink:href="Pictures/' . substr($setari_client->cale_banner, 22) . '" xlink:type="simple"
                                xlink:show="embed" xlink:actuate="onLoad"/>
                </draw:frame>
            </text:p>';
    }
    $content_xml .= '
            <text:p text:style-name="P8">' . htmlspecialchars($client->nume) . '</text:p>
            <text:p text:style-name="P6">' . getAdresaAsString($client->adresa) . '</text:p>    
            <text:p text:style-name="P6">' . LANG_cod_fiscal . ' ' . htmlspecialchars($client->cf) . '</text:p>
            <text:p text:style-name="P6">' . LANG_RC . ' ' . htmlspecialchars($client->rc) . '</text:p>
            <text:p text:style-name="P9">
                <text:p text:style-name="T5">' . LANG_Catre . '</text:p>
            <text:p>
            <text:p text:style-name="P10">' . htmlspecialchars($firma_exec->nume) . '</text:p>
            <text:p text:style-name="P7">' . getAdresaAsString($firma_exec->adresa) . '</text:p>
            <text:p text:style-name="P7">' . LANG_cod_fiscal . ' ' . htmlspecialchars($firma_exec->cf) 
                                            . LANG_RC . ' ' . htmlspecialchars($firma_exec->rc) . '</text:p>
            <text:p text:style-name="P7">' . LANG_TEL_FAX . ' ' . htmlspecialchars($firma_exec->tel_fax) . '</text:p>
            <text:p text:style-name="P7">' . LANG_Contact . ' ' . htmlspecialchars($contact_nume) . '</text:p>
            <text:p text:style-name="P7" />
            <text:p text:style-name="P2">';
//            if ($comanda->interna_externa == CT_COMANDA_INTERNA)
//                $content_xml .= LANG_Comanda_interna_de_transport;
//            else
//                $content_xml .= LANG_Comanda_externa_de_transport;
            $content_xml .= LANG_Comanda_de_transport;
    $content_xml .= '
            </text:p>
            <text:p text:style-name="P9">' . LANG_Nr . " " . htmlspecialchars($comanda->nr_comanda_exec) . '</text:p>
            <text:p text:style-name="P2" />';